<template>
  <div class="wrap">
    <div class="kongbai"></div>
    <school-title Cname="学员作品"></school-title>
    <div class="works-content">
      <div class="works-pic" v-for="item in works" :key="item.id">
        <img :src="'https://ss.lanqb.com/' + item.work_url" alt="" />
      </div>
    </div>
  </div>
</template>

<script>
import SchoolTitle from "@/components/schoolTitle.vue";
export default {
  name: "SchoolWorks",
  data() {
    return {
      works: [],
    };
  },
  components: {
    SchoolTitle,
  },

  mounted() {},

  methods: {},
  created() {
    fetch("https://m.lanqb.com/api/school/works?limit=9&sort=-top_weight")
      .then((res) => res.json())
      .then((data) => {
        this.works = data.data;
        console.log(this.works);
      });
  },
};
</script>

<style lang="scss" scoped>
* {
  margin: 0;
  padding: 0;
}
.kongbai {
  width: 100%;
  height: 15px;
  background-color: #eee;
}
.wrap {
  padding: 0 10px;
  .works-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    .works-pic {
      img {
        width: 126px;
        height: 94px;
        border-radius: 5px;
      }
    }
  }
}
</style>
